/*
 *  motion.h
 *
 *  openFrameworks
 *
 *  Created by lucas bigeardel on 25/05/10.
 *  Copyright Lucas Bigeardel 2010. All rights reserved.
 *  This file is part of Fmurf.
 *
 *  Fmurf is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Fmurf is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Fmurf.  If not, see <http://www.gnu.org/licenses/>
 *
 */

#ifndef _FMF_MOTION
#define _FMF_MOTION

#include "ofGraphics.h"
#include "ofxPoint3f.h";
#include "ofxThread.h"


enum Ofx3nityMotionFormKind {
	OFX3NITY_MOTION_FORM_SIN,
	OFX3NITY_MOTION_FORM_SAW,
	OFX3NITY_MOTION_FORM_SQR,
	OFX3NITY_MOTION_FORM_TRI,
	OFX3NITY_MOTION_FORM_AFFINE,
	OFX3NITY_MOTION_FORM_CUBIC,
	OFX3NITY_MOTION_FORM_QUADRATIC
};

enum Ofx3nityMotionCinematicKind {
	OFX3NITY_MOTION_CINEMATIC_INFINITE,
	OFX3NITY_MOTION_CINEMATIC_ONCE,
	OFX3NITY_MOTION_CINEMATIC_COMPLEX
};

class Ofx3nity3DParticle {
public:
	ofxVec3f *pos;
	ofxVec3f *accel;
	ofxVec3f *rot;
	float speed;
	float radiosity;
	float charge;
};

class Ofx3nityMotion {
public:
	Ofx3nityMotionFormKind kind;
	Ofx3nityMotionCinematicKind cinematic;
	int sampling;
	float speed;
	Ofx3nityMotion(Ofx3nityMotionFormKind _kind, Ofx3nityMotionCinematicKind _cinematic, int _sampling, float _speed) {
		kind = _kind;
		cinematic = _cinematic;
		sampling = _sampling;
		speed = _speed;
	}
};

class Ofx3nityMotionEngine : public ofxThread {
private:
	Ofx3nityMotion *motion;
	vector<Ofx3nity3DParticle *> *particles;
public:
	Ofx3nityMotionEngine(Ofx3nityMotionFormKind _kind, Ofx3nityMotionCinematicKind _cinematic, int _sampling, float _speed) {
		motion = new Ofx3nityMotion(_kind, _cinematic, _sampling, _speed);
		particles = new vector<Ofx3nity3DParticle *>();
	}
};

#endif